/*****************************************************************************
 *
 *                      HUSONG PROPRIETARY INFORMATION
 *
 *          The information contained herein is proprietary to HUSONG
 *           and shall not be reproduced or disclosed in whole or in part
 *                    or used for any design or manufacture
 *              without direct written authorization from HUSONG.
 *
 *            Copyright (c) 2015 by HUSONG.  All rights reserved.
 *
 *****************************************************************************/
package com.broker.consumer.controller;

import me.send.broker.entity.Sysconfig;
import me.send.broker.entity.base.ReturnJsonBean;
import me.send.broker.enums.AuthodType;
import me.send.business.base.SendVariable;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.broker.consumer.controller.base.BaseController;

/**
 * @author maxmin
 *
 * @date 2015年8月27日 上午10:35:44
 */
@Controller
@RequestMapping(value = "sysconfig")
public class SysconfigController extends BaseController {
	// 呼送热线
	@RequestMapping("phone")
	@ResponseBody
	public ReturnJsonBean phone(String devicenumber) {
		ReturnJsonBean rb = new ReturnJsonBean();
		try {
			Sysconfig sysconfig = sysconfigService.object_keye(devicenumber,
					SendVariable.CONFIG_PHONE);
			rb.setCode(ReturnJsonBean.SUCCESS);
			rb.setMessage(ReturnJsonBean.SUCCESS_STR);
			rb.setDatas(sysconfig);
		} catch (Exception e) {
			saveException(AuthodType.tangjianglong.getName(),
					"SysconfigController", "phone()", e);
			e.printStackTrace();
		}
		return rb;
	}

	// 用户注册协议
	@RequestMapping("user/reg")
	@ResponseBody
	public ReturnJsonBean user_reg(String devicenumber) {
		ReturnJsonBean rb = new ReturnJsonBean();
		try {
			Sysconfig sysconfig = sysconfigService.object_keye(devicenumber,
					SendVariable.CONFIG_USER_REG);
			rb.setCode(ReturnJsonBean.SUCCESS);
			rb.setMessage(ReturnJsonBean.SUCCESS_STR);
			rb.setDatas(sysconfig);
		} catch (Exception e) {
			saveException(AuthodType.tangjianglong.getName(),
					"SysconfigController", "phone()", e);
			e.printStackTrace();
		}
		return rb;
	}
}
